﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;

namespace AAPlus.Tests
{
    [TestFixture]
    public class MathExtraTests
    {
        [Test]
        public void ModFloatTest()
        {
            var integerPart = 0f;
            var remainderPart = MathExtra.Mod(12.54f, out integerPart);
            Assert.AreEqual(integerPart, 12.00f, "Integer part calculated incorrectly");
            Assert.IsTrue(remainderPart.ToString() == 0.54f.ToString(), "Remainder calculated incorrectly (was {0}, but expecting {1})", 0.54f, remainderPart);
        }

        [Test]
        public void ModDoubleTest()
        {
            var integerPart = 0d;
            var remainderPart = MathExtra.Mod(12.54d, out integerPart);
            Assert.AreEqual(integerPart, 12.00d, "Integer part calculated incorrectly");
            Assert.IsTrue(remainderPart.ToString() == 0.54d.ToString(), "Remainder calculated incorrectly (was {0}, but expecting {1})", 0.54d, remainderPart);
        }
    }
}
